Interface Your Computer to the Real World

(Velleman K8055 Kit)

© 2005, Rod

author contact:

rodbird@hotmail.com

NL133 Home

::::::::::::::::::::::::::::::::::::::::::::::::::::

Chat Challenge

Eddie Version 3

Stylebits Corner

Progress Bars

Velleman Interface

Sprite Byte

Simulating BMP Buttons

Program Security

LB Functions

::::::::::::::::::::::::::::::::::::::::::::::::::::

Submission Guildlines

Newsletter Help

Index

I have always had an interest in electronics and I see from a number of posts to the forums there is a level of interest in interfacing electronics to the PC. One enterprising young man even wants to launch rockets under computer control.

Picture the scene. Tense drama, the rocket stands shimmering in the late afternoon sun, sweat beads on the launch commander's brow as the final checks proceed. A klaxon sounds. All eyes are on the launch pad, the audience holds its' breath........ "Bummer" comes a feint cry from the control room, the communication speaker rasps into life. "What's wrong?" shouts the commander. An agitated technician stands, all eyes are upon him, "Is Empty not understood" he shouts back. Hearing a noise from behind, the audience turns as one, to see the rocket flop onto the grass and blast the dog kennel to pieces.

Ok there are three hurdles to get over. The first is that you need to be competent enough to write a program to drive or read the electronics, a relatively straight forward task with Liberty BASIC. The second hurdle is that you need to physically connect the electronics to the computer. This typically means using the serial or parallel ports, though the game port can be used. This in itself creates the third and steepest hurdle in that you need to be competent enough to write a program that can manage and manipulate these ports. That's where the shouts for help usually arise.

In this article and an associated .bas, file I will show you how to bypass all that with a modern USB based connection.

[Velleman Components NV] produces a hobbyist kit for a relatively modest price that provides 5 digital in and 8 digital out combined with 2 analog in and 2 analog or pulse width modulated outs (PWM). There are also two onboard pulse counters linked to digital in channels and amplification for weak analog signals. The board is based around a PIC microcontroller buzzing away at 6MHz. There are onboard test buttons and LEDs and the package is an ideal starter pack if you are new to the subject.

The board is purchased in kit form but is very easy and rewarding to assemble. Simple, screw block terminals allow all sorts of connections to the outside world. Once built it is just a matter of firing up the software and plugging in the USB cable. Windows takes care of the connection and a supplied DLL allows Liberty BASIC coders full access to all the board's functions.

The Velleman.bas file simply mimics the VB application that ships with the board. Its main purpose is to show you how to call all of the DLL's functions. The board executes an instruction in about 20ms though the onboard counters are faster than that. You won't be building real time oscilloscopes but it's plenty fast enough for robotics, turtles, alarms, oh! and rocket launches.

Sequenced digital outs can drive stepper motors. The PWM outputs can be used to drive motors and the analog or pulse count inputs used to determine the position or speed of those motors. Temperature, light, sound, vision systems, PIR, IR beams the list is endless and I'm not going to attempt to cover it here. If you have read this far you probably know what you're going to connect already.

If you need a little inspiration try "The Robot Builder's Bonanza", ISBN 0-07-136296-7.

You should find the DLL very easy to use. I have included comments but in any event the board comes with good documentation and web site support. So, with two of the hurdles out the way, dig out your soldering iron and get coding.


The file ( Velleman.bas ) is included in the zipped archive of this newsletter.


NL133 Home

::::::::::::::::::::::::::::::::::::::::::::::::::::

Chat Challenge

Eddie Version 3

Stylebits Corner

Progress Bars

Velleman Interface

Sprite Byte

Simulating BMP Buttons

Program Security

LB Functions

::::::::::::::::::::::::::::::::::::::::::::::::::::

Submission Guildlines

Newsletter Help

Index